import fetch from 'common/src/utils/fetch';
export function getList(data) {
    return fetch({
        url: '/api/designservice/doc/task/book/list',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    });
}

export function addData(data) {
    return fetch({
        url: '/api/designservice/doc/task/book/add',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    });
}

export function editData(data) {
    return fetch({
        url: '/api/designservice/doc/task/book/edit',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    });
}

export function viewData(id) {
    return fetch({
        url: '/api/designservice/doc/task/book/view?id=' + id,
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    });
}

export function auditSingle(data) {
    return fetch({
        url: '/api/designservice/doc/task/audit/single',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    });
}

export function recall(grade, no) {
    return fetch({
        url: '/api/designservice/doc/task/book/recall?no='+no + '&grade=' + grade,
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    });
}

export function auditBatch(data) {
    return fetch({
        url: '/api/designservice/doc/task/audit/batch',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    });
}

export function getSelectOpt(grade, studentId) {
    return fetch({
        url: '/api/designservice/doc/task/book/select?grade='+ grade + '&studentId=' + studentId,
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    });
}

export function getSubjectType(data) {
    return fetch({
        url: '/api/designservice/common/subjectType?studentId='+ data,
        method: 'get',
        headers: { 'Content-Type': 'application/json' },
    });
}

export function getAuditList(data) {
    return fetch({
        url: '/api/designservice/doc/task/audit/list',
        method: 'post',
        headers: { 'Content-Type': 'application/json' },
        data
    });
}

export function exportData(data) {
    return fetch({
      url: '/api/designservice/doc/task/book/export',
      method: 'post',
      headers: { 'Content-Type': 'application/json' },
      data: data
    })
  }

export function getExportStatus(key) {
    return fetch({
        url: `/api/designservice/resultPublish/result/${key}`,
        method: 'get',
        showMask: false
    })
}
